package mr.ali.webvideo.mapper;

import mr.ali.webvideo.model.OpenId;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author Mr-ali
 * @since 2025-08-16
 */
@Repository
public interface OpenIdMapper extends BaseMapper<OpenId> {

    @Select("select * from open_id where open_id=#{openId}")
    OpenId getOpenId(String openId);


    @Update("update open_id set status=#{status} where id=#{id}")
    Integer deleteStatus(@Param("id") Integer id, @Param("status") Integer status);


    @Update("update open_id set status=#{status},status_create=#{statusCreate} where id=#{id}")
    Integer updateStatus(@Param("id") Integer id, @Param("status") Integer status, @Param("statusCreate") Long statusCreate);

    @Update("update open_id set yes_money=#{yesMoney} where id=#{id}")
    Integer updateYesMoney(@Param("id") Integer id, @Param("yesMoney") Double yesMoney);

    @Update("update open_id set not_money=#{notMoney} where id=#{id}")
    Integer updateNotMoney(@Param("id") Integer id, @Param("notMoney") Double notMoney);

}
